package com.lam.dormitory.service;

import com.lam.dormitory.entity.Dormitory;
import com.lam.dormitory.entity.DormitoryService;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lam.dormitory.util.ResponseTemplate;
import com.lam.dormitory.vo.*;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lam
 * @since 2019-12-26
 */
public interface IDormitoryServiceService extends IService<DormitoryService> {
    /**
     * 根据DorId查找DormitoryServiceVo
     * @param dorId
     * @return
     */
    List<DormitoryServiceVo> selectDsVoByDorId(Long dorId);

    /**
     * 根据查找DormitoryServiceVo
     * @return
     */
    List<DormitoryServiceVo> selectDsVo(DormitoryService dormitoryService);

    /**
     * 根据查找DormitoryServiceDetailVo
     * @return
     */
    List<DormitoryServiceDetailVo> selectDsDetailVo(DormitoryService dormitoryService);

    /**
     * 根据月份 宿舍楼 宿舍号查找实体
     * @param dsMonth
     * @param buildingNo
     * @param dorNo
     * @return
     */
    DormitoryService selectByBuildingNoAndDorNoAndMonth(Date dsMonth,Integer buildingNo,Integer dorNo);

    /**
     * 批量insert无重复
     * @param list
     * @return
     */
    ResponseTemplate saveBatch(List<DormitoryServiceVo> list);

    /**
     * 统计过去12个月的数据(包括本月)
     * @return
     */
    List<ChartVo> monthTotalChart();

    /**
     * 某（或范围）月份各宿舍楼总用电 x：楼号 y：用量
     * @param dormitoryService
     * @return
     */
    List<ChartVo> monthBuildingTotalChart(DormitoryService dormitoryService);

    /**
     * 搜索无重复的buildingNo
     * @return
     */
    List<DormitoryService> selectBuildingNo();
    /**
     * 某（范围）月某（范围）栋各 宿舍号 电费使用统计图
     */
    List<ChartVo>  monthBuildingDorNoTotal(DormitoryService dormitoryService);

    /**
     * 某（范围）月各宿舍楼 宿舍情况
     * @param dormitoryService
     * @return
     */
    List<ChartHygieneVo> monthHygieneTotal(DormitoryService dormitoryService);

    /**
     * 某月某宿舍楼 各宿舍卫生情况
     * @param dormitoryService
     * @return
     */
    List<ChartHygieneVo> monthBuildingDorNoHygieneTotal(DormitoryService dormitoryService);

}
